<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>

<!DOCTYPE html>
<html lang="zh-CN"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<meta charset="UTF-8">
	<title>凯盛项目管理系统</title>
	<link rel="stylesheet" type="text/css" href="css/bootstrap.css">
	<script type="text/javascript" src="js/jquery.js"></script>
	<script type="text/javascript" src="js/bootstrap.js"></script>
	<script type="text/javascript" src="js/bootstrap-modal.js"></script>
	<script type="text/javascript" src="js/bootstrap-transition.js"></script>
	<script type="text/javascript">
		$(document).ready(function(){
				
				$("#newIdea").click(function(){
				    $('#myModal').modal(option);
				});
				$("#btn").click(function(){
					$("#myform").submit();
				});
		});
	</script>
</head>
<body class="body">
	<jsp:include page="include/head.jsp">
		<jsp:param value="${ep}" name="ep"/>
	</jsp:include>
		
	
	<div class="container">
	  <div class="row">
		<div class="span3">
			<div style="padding: 8px 0;" class="well">
				<jsp:include page="include/nav.jsp">
					<jsp:param value="idea" name="tag"/>
				</jsp:include>
			</div>
		</div>
		
		<div class="span9">
			<ul class="breadcrumb" style="margin-bottom:0px;border-radius: 3px 3px 0 0;margin-top:15px">
				<li class="active">
					<a ><i class="icon-fire"></i>想法</a>
				</li>
				<li class="pull-right"><i class="icon-plus"></i><a id="newIdea" href="#myModal" data-toggle="modal" class="link-black">发表想法</a></li>
			</ul>
			<!-- 发表新想法 -->
			<div class="modal fade" id="myModal" class="modal hide fade" style="display:none;">
				<div class="modal-header">
					<a class="close" data-dismiss="modal">×</a>
					<h3>发表新想法</h3>
				</div>
				<div class="modal-body">
					<form action="idea.jspx" method="post" id="myform">
				        <fieldset>
				          <input type="hidden" name="m" value="newIdea">
				          <div class="control-group">
				            <label class="control-label" for="input01">标题</label>
				            <div class="controls">
				              <input type="text" style="width:520px;" id="input01"  name="title">
				            </div>
				          </div>
						  <div class="control-group">
				            <label class="control-label" for="input01">内容</label>
				            <div class="controls">
				              <textarea name="content" id="" style="width:520px;" rows="8"></textarea>
				            </div>
				          </div>
				        </fieldset>
			      </form>          
				</div>
				<div class="modal-footer">
					<button type="button" id="btn" class="btn btn-primary" style="margin-left:20px;">保存</button>
					<a class="btn" data-dismiss="modal" href="">关闭</a>
				</div>
			</div>
			
			<div class="wall" style="margin-bottom:20px;">
				<c:if test="${fn:length(page.result) == 0 }">
					<blockquote>
					    <h4>没有想法！</h4>
					</blockquote>
				</c:if>
				<c:forEach items="${page.result}" var="idea">
					<blockquote style="background-color:#F5F5F5;">
						 <h4>主题：<a href="idea.jspx?ideaId=${idea.id}&p=${page.pageNum}&m=showIdea">${idea.title }</a>
						 </h4>
						 <p style="font-size:14px;line-height:1.5;">${idea.shortcontent}</p>
						 <small>${idea.e.name}发表于 ${idea.tiptime}
						 	 
							 <c:if test="${ep.e.zhiwei=='管理员'}">
								 <a style="margin-left:20px;"  href="idea.jspx?m=delIdea&ideaId=${idea.id}&p=${page.pageNum}" title="删除"><i class="icon-trash"></i></a>
							 </c:if>
						 </small>
						
					</blockquote>
				</c:forEach>
				
				<jsp:include page="include/pager.jsp">
					<jsp:param value="${page}" name="page"/>
					<jsp:param value="idea.jspx" name="jspx"/>
				</jsp:include>
				
				<div class="clear"></div>
			</div>
		</div>
	  </div>
	</div>
	<script type="text/javascript">
		
	</script>
</body></html>
